package com.lsw.jgyf.adapter;

import android.content.Context;
import android.view.View;
import android.widget.TextView;

import com.lsw.Base.BaseHolder;
import com.lsw.Base.BaseSimpleAdapter;
import com.lsw.jgyf.R;
import com.lsw.jgyf.model.StagingCompanyDetailsModel;

/**
 * Created by Administrator on 2018/7/24 0024.
 */

public class CompanyDetailsItemAdapter extends BaseSimpleAdapter<StagingCompanyDetailsModel.ProductListEntity.RateListEntity> {
    public CompanyDetailsItemAdapter(Context context) {
        super(context);
    }

    @Override
    protected BaseHolder<StagingCompanyDetailsModel.ProductListEntity.RateListEntity> getHolder() {
        return new BaseHolder<StagingCompanyDetailsModel.ProductListEntity.RateListEntity>() {
            TextView tv_fujiaxian;
            TextView tv_qishu;
            TextView tv_linv;

            @Override
            public void bindViews(View parentView) {
                tv_fujiaxian = parentView.findViewById(R.id.tv_fujiaxian);
                tv_qishu = parentView.findViewById(R.id.tv_qishu);
                tv_linv = parentView.findViewById(R.id.tv_linv);
            }

            @Override
            public void bindData(StagingCompanyDetailsModel.ProductListEntity.RateListEntity item, int position) {
                tv_fujiaxian.setText(item.getInsurance_name());
                tv_qishu.setText(item.getPeriods() + "");
                tv_linv.setText(item.getRate() + "%");
            }
        };
    }

    @Override
    protected int getLayoutResource() {
        return R.layout.item_company_details_item;
    }
}
